//
//  NetManager.h
//  Sports
//
//  Created by up72_01 on 15/8/27.
//  Copyright (c) 2015年 wisdom. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "LoadingView.h"


@class NetManager;

@protocol NetManagerDelegate <NSObject>

- (void)requestStart:(NetManager *)request;
- (void)requestDidFinished:(NetManager *)request result:(NSMutableDictionary *)result;
- (void)requestError:(NetManager *)request error:(NSError*)error;

@end

@interface NetManager : NSObject


@property (nonatomic, retain)   NSString *loadingText;
@property (nonatomic, readonly) BOOL isShowLoading;
@property (nonatomic, readonly) BOOL isRequesting;
@property (nonatomic) NSInteger requestId;
@property (nonatomic, retain) NSDictionary *requestDic;


@property(assign, nonatomic) id <NetManagerDelegate> delegate;

- (void)removeLoadingView;

- (void)sendPOSTRequestToServerWithURL:(NSString *)urlString postData:(NSMutableDictionary *)messageDic;
- (void)sendPOSTRequestToServerWithURL:(NSString *)urlString postData:(NSMutableDictionary *)messageDic deCode:(NSString *)deCode;

//文件上传
- (void)uploadWithUrl:(NSString *)url body:(NSDictionary *)body method:(NSString *)method constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))bodyBlock;
@end
